﻿<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl" %>
<ul id="tree" class="tree">
    <% For Each item In ViewData("SiteList")%>
    <li id="slRow_<%: item.ID%>"><span>
        <input type="image" id="btnNode_<%: item.ID%>" src="../../content/img/minus.gif"
            style="border-width: 0px;" onclick="javascript:hideNode(<%: item.ID%>); return false;" />
    </span><span style="background: url('../../content/img/folder.png') no-repeat left top;
        display: block; padding: 3px 0 3px 25px; margin-bottom: 5px;">&nbsp; </span><span
            class="title" onclick="selectSite(<%: item.ID%>,'<%: item.Description%>',<%= item.IsActive.ToString().ToLower() %>,'<%: item.TimeZoneID%>');">
            <%: item.Description%><span id="siteAddr_<%: item.ID%>" class="hidden"><%: item.Address%></span>
        </span>
        <% If item.IsActive Then%>
        <span style="background: url('../../content/img/active.gif') no-repeat left; padding: 3px 0 3px 20px; display: block; float:right;">&nbsp; </span>
        <% Else%>
        <span style="background: url('../../content/img/inactive.gif') no-repeat left; padding: 3px 0 3px 20px; display: block; float:right;">&nbsp; </span>
        <% End If%>
        <br />
        <div id="node_<%: item.ID%>">
            <% For Each locationItem In item.Childs%>
            <div id="locationNode_<%: locationItem.ID %>" class="node" onclick="selectDepartment(<%: locationItem.ID %>, '<%: locationItem.Description%>','<%: item.Description%>',<%= locationItem.IsActive.ToString().ToLower() %>)">
                <span style="background: url('../../content/img/doc.png') no-repeat left top; display: block;
                    padding: 3px 0 3px 15px; margin-bottom: 2px;">&nbsp; </span><span class="title">
                        <%: locationItem.Description%></span><span id="locAddr_<%: locationItem.ID %>" class="hidden"><%: locationItem.Address%></span>
                <% If locationItem.IsActive Then%>
                <span style="background: url('../../content/img/active.gif') no-repeat left; padding: 3px 0 3px 15px; display: block; float:right;">&nbsp; </span>
                <% Else%>
                <span style="background: url('../../content/img/inactive.gif') no-repeat left; padding: 3px 0 3px 15px; display: block; float:right;">&nbsp; </span>
                <% End If%>
            </div>
            <br />
            <% Next%>
        </div>
    </li>
    <% Next%>
</ul>
